Repository navigation
fix(web): spreadsheet text and fills no longer vanish when their cell scrolls out - #41263
Merged
Merged
Conversation
… scrolls out Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Cursor <cursoragent@cursor.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
In the spreadsheet preview, scrolling a little to the right made content disappear: titles spilling across empty columns, merged headers and their fills vanished as soon as the cell that owns them left the screen. Merged blocks spanning rows lost their text the same way once their top row scrolled out. The engine (
@betteroffice/xlsx) draws only cells whose column and row start inside the requested viewport, so anything anchored before the viewport's first track was dropped.Change
The spreadsheet worker asks the engine for an area that starts up to 1024 px further left and 512 px further up than the frame (
reachinsheet-frame.ts), then crops it back to the frame while painting. Frozen panes stay where the engine drew them, and only the cells past them move. The grid used for headers, selection and hit tests still comes from the frame's own viewport, and the bitmap sent to the window is the same size as before.Cost: on a dense sheet, engine time per frame goes from about 4.6 ms to 6.4–9.7 ms in the worker (measured headlessly). Frames are only built when scrolling past the cached area. Content anchored more than
reachbefore the viewport still clips.Scope
A small fix for an obvious rendering bug reported directly by a maintainer while previewing a workbook, so there is no separate issue.
Verification
sheet-resize.browser.test.ts: text overflowing from a column scrolled out sideways, and a vertically centred merge whose top row scrolled out, with and without frozen panes. Both cases fail onmainand pass here.vp run check:changedpasses; all 93 office tests inapps/web/src/components/filespass.sheet-frame.ts.Videos of the scroll: before.mp4 · after.mp4
Made with Claude Opus 5.5 in T3 Code (Cursor harness).